 $(function(){
 	 $("#upload").click(function(){
 	 	$("#upload-panel").fadeIn("slow");
 	 	 $('#upload-panel  img').click(function(){
 	 	 	 var url = $(this).attr("src");
	        $('#upload').attr("src",url);
 	 	 });

 	 })
 	 $(".close").click(function(){
 	 	$("#upload-panel").fadeOut("slow");
 	 })

     });
	// 饼图
		 $('#Doughnut').highcharts({
			chart: {
				plotBackgroundColor: null,
				plotBorderWidth: null,
				plotShadow: false
			},
			title: {
				text: ''
			},
			credits : {
				enabled: false
			},
			legend: {
				enabled: 0
			},
			tooltip: {
				enabled : false,
				pointFormat: '{point.name}: <b>{point.percentage:.1f}%</b>'
			},
			plotOptions: {
				pie: {
					allowPointSelect: true,
					cursor: 'pointer',
					dataLabels: {
						enabled: false,
						color: '#000000',
						connectorColor: '#000000',
						format: '<b>{point.name}</b>: {point.percentage:.1f} %'
					}
				}
			},
			series: [{
				type: 'pie',
				name: 'Browser share',
				innerSize : "94%",
				 data: [
				{
					name: "可用余额",
					y: balance,
					color : "#ecc346"
				},
				{
					name: "冻结金额",
					y: frozenMoney,
					color : "#e71a19"
				},
				{
					name: "待收本息",
					y: dueTotal,
					color : "#77bd0e"
				},
				{
					name: "暂无数据",
					y: 0,
					color : "#ccc"
				}
			]			
			}]
	});
		 
		 
function changeHeadImg(obj){
	$("#upload-panel").fadeOut("slow");
	var srcurl = $(obj).attr("src");
	$.post("/account/set/nickimg",{nickImg :srcurl}, function(data){
		var resultData = $.parseJSON(data);
		if(resultData.result.status == 1){
			layer.msg(resultData.result.successMessage);
		}else{
			layer.msg(resultData.result.errorMessage);
		}
	});
	
}
